const { Article } = require('../../model/article')
const pagination = require('mongoose-sex-page');



module.exports = async (req,res) => {
// 获取页码值
   const page =  req.query.page;
// 数据库查询的数据
 let result = await pagination(Article).page(page).size(2).display(5).find().populate('author').exec();

// 渲染模版并传递数据
    res.render('home/default.art', {
        result:result
    });
}